package creational

import (
	"os"
)

// 常用于给结构体设置扩展的属性值

type Options struct {
	UID        int
	GID        int
	Flags      int
	Contents   string
	Permission os.FileMode
}

type Option func(*Options)

func UID(uid int) Option {
	return func(args *Options) {
		args.UID = uid
	}
}

func GID(gid int) Option {
	return func(args *Options) {
		args.GID = gid
	}
}

func Flags(flags int) Option {
	return func(options *Options) {
		options.Flags = flags
	}
}

func Contents(content string) Option {
	return func(options *Options) {
		options.Contents = content
	}
}

func Permission(mode os.FileMode) Option {
	return func(options *Options) {
		options.Permission = mode
	}
}
